<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('openid', 190)->unique()->nullable()->comment('微信openid');
            $table->string('nick_name', 150)->index()->nullable()->comment('用户昵称');
            $table->text('avatar')->nullable()->comment('用户头像');
            $table->string('unionid', 190)->index()->nullable()->comment('微信唯一标识');
            $table->integer('member_id')->index()->nullable()->comment('会员ID');
            $table->timestamps();
            $table->softDeletes();
        });
    }
    /**
    * Reverse the migrations.
    *
    * @return void
    */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
